var Main = {
        data() {
            return {
                labelPosition: 'right',
                connectData: {
                    operate: 'connect',
                    host: '',
                    port: '22',
                    username: 'root',
                    password: ''
                }
            };
        },
        methods: {
            getContextPath: function() {
                var pathName = document.location.pathname;
                var index = pathName.substr(1).indexOf("/");
                var result = pathName.substr(0,index+1);
                return result;
            },
            onSubmit: function () {
                console.log('submit!');
                window.localStorage.setItem("connectData", JSON.stringify(this.connectData));
                window.location.href = this.getContextPath()+'/websshpage';
            },
            reset: function () {
                this.connectData.host = '';
                this.connectData.username = '';
                this.connectData.password = '';
            }
        }
    },
    Ctor = Vue.extend(Main);
    new Ctor().$mount('#app')